package net.mysoft.framework.util;

import java.util.HashMap;
import java.util.Map;

@SuppressWarnings({"rawtypes", "unchecked"})
public class Maps {
	
	private Map map;
	
	public Maps() {
		map = new HashMap();
	}
	
	public Maps put(Object key, Object value) {
		map.put(key, value);
		return this;
	}
	
	public Map build() {
		return map;
	}
	
	public static Map newHashMap() {
		return new HashMap();
	}
	
	public static Map newHashMap(Object...objs) {
		Map map = new HashMap();
		int len = objs.length;
		if(objs!=null&&len>0) {
			for(int i=0;i<len;i=i+2) {
				if(i+1<len) map.put(objs[i], objs[i+1]);
				else map.put(objs[i], null);
			}
		}
		return map;
	}
	
}
